import Flutter
import UIKit

public class LibMusicPlugin: NSObject, FlutterPlugin {
  public static func register(with registrar: FlutterPluginRegistrar) {
      
      //权限处理逻辑
      FlutterPermissionImpl.sharedInstance.setFlutterBinaryMessenger(binaryMessenger: registrar.messenger())
      
      //播放音乐处理逻辑
      FlutterMicImpl.sharedInstance.setFlutterBinaryMessenger(binaryMessenger: registrar.messenger())
      //麦克风录音
      //FlutterMic2Impl.sharedInstance.setFlutterBinaryMessenger(binaryMessenger: registrar.messenger())
  }

  public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
    switch call.method {
    case "getPlatformVersion":
      result("iOS " + UIDevice.current.systemVersion)
    default:
      result(FlutterMethodNotImplemented)
    }
  }
}
